From: Umang Jain Date: Thu, 5 Jul 2018 11:37:34 +0000 (+0530) Subject: repo: Reword min-free-space-size option's error strings X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~21^2~10 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=eeacbc6b29fe1ab38471ed4362c0fdefd7298d19;p=ostree.git repo: Reword min-free-space-size option's error strings It is important that we use user-friendly error strings. The reason being error strings are seen by users such as in GNOME Software's error banner. Closes: #1671 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 53d5cfda..cae38e6d 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -2670,7 +2670,7 @@ min_free_space_size_validate_and_convert (OstreeRepo *self, g_autoptr(GMatchInfo) match = NULL; if (!g_regex_match (regex, min_free_space_size_str, 0, &match)) - return glnx_throw (error, "Failed to match '^[0-9]+[GMT]B$'"); + return glnx_throw (error, "It should be of the format '123MB', '123GB' or '123TB'"); g_autofree char *size_str = g_match_info_fetch (match, 1); g_autofree char *unit = g_match_info_fetch (match, 2); @@ -2693,7 +2693,7 @@ min_free_space_size_validate_and_convert (OstreeRepo *self, guint64 min_free_space = g_ascii_strtoull (size_str, NULL, 10); if (shifts > 0 && g_bit_nth_lsf (min_free_space, 63 - shifts) != -1) - return glnx_throw (error, "Integer overflow detected"); + return glnx_throw (error, "Value was too high"); self->min_free_space_mb = min_free_space << shifts;